Skip to content

fix(agent): keep public-safe packets free of private evidence - #892

Merged
JSONbored merged 1 commit into
mainfrom
codex/fix-public-safe-packet-vulnerability
Jun 19, 2026
Merged

fix(agent): keep public-safe packets free of private evidence#892
JSONbored merged 1 commit into
mainfrom
codex/fix-public-safe-packet-vulnerability

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Motivation

  • Prevent leakage of private scoreability/provenance metadata from agent actions labeled public_safe by ensuring recommendation evidence is not serialized into public-safe action payloads.

Description

  • Change actionRecord in src/services/agent-orchestrator.ts to only attach payload.recommendationEvidence when the action safetyClass is not public_safe (preserving evidence for private actions).
  • Preserve existing prepare_pr_packet behavior as public_safe while removing attached localBranchEvidence from the returned public payload by making evidence injection conditional on safetyClass.
  • Add unit assertions in test/unit/agent-orchestrator.test.ts to verify that prepare_pr_packet actions remain public_safe and that their payload does not include recommendationEvidence or private score terms.

Testing

  • Ran type checking with npm run typecheck which completed successfully.
  • Ran the updated unit tests with npx vitest run test/unit/agent-orchestrator.test.ts, all tests passed (1 test file, 17 tests).
  • Sanity checks (e.g., git diff --check) were run as part of validation and reported no issues.

Codex Task

@ghost

ghost commented Jun 18, 2026

Copy link
Copy Markdown

Note

Gittensory Gate skipped

PR closed before full evaluation. No late first comment was created.

Signal Result Evidence Action
Gate result ⚠️ Skipped #892 is no longer open. No action.

💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.

@ghost ghost added the gittensory:reviewed label Jun 18, 2026
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@codecov

codecov Bot commented Jun 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.71%. Comparing base (5d9d73a) to head (5dd80b7).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #892   +/-   ##
=======================================
  Coverage   96.71%   96.71%           
=======================================
  Files         108      108           
  Lines       14641    14643    +2     
  Branches     5298     5299    +1     
=======================================
+ Hits        14160    14162    +2     
  Misses        102      102           
  Partials      379      379           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ghost

ghost commented Jun 18, 2026

Copy link
Copy Markdown

gittensory · advisory review

Reviewed 2 changed file(s) — two independent AI reviewers.

Changed files: src/services/agent-orchestrator.ts, test/unit/agent-orchestrator.test.ts

Suggested action:Safe to merge — both reviewers found no blocking issues.

Reviewer A · gpt-oss-120b — recommends ✅ merge
The PR updates the agent orchestrator to omit private recommendation evidence from payloads when the safety class is "public_safe", aligning with the public/private boundary policy. Tests are added to verify the omission and ensure no private strings leak.

Suggestions

  • Add a unit test confirming that when safetyClass is not "public_safe" (e.g., "private"), the recommendationEvidence field is included as expected.
  • Verify that downstream consumers of the payload gracefully handle the absence of recommendationEvidence for public_safe actions.

Worth double-checking

  • Potential downstream code assuming recommendationEvidence always exists may encounter undefined; ensure it tolerates missing field.
  • Make sure the default safetyClass handling remains consistent across all callers.

Reviewer B · nemotron-3-120b-a12b — recommends ✅ merge
The PR modifies actionRecord to conditionally include recommendationEvidence only when safetyClass is not 'public_safe', ensuring public-safe packets do not contain private evidence. Tests are added to verify this behavior for the prepare_pr_packet action. The change correctly enforces the public/private boundary invariant.

Suggestions

  • Consider explicitly deleting recommendationEvidence from payload for public_safe safetyClass to guard against accidental inclusion via args.payload.
  • Add a comment explaining the guard to aid future maintainers.
  • If other public_safe action types exist, add test coverage for them to ensure consistent behavior.

Worth double-checking

  • If a caller mistakenly includes recommendationEvidence in args.payload for a public_safe action, it would not be stripped and could leak private info.
  • Ensure no other payload fields inadvertently contain private evidence for public_safe actions.

@JSONbored
JSONbored merged commit f23e831 into main Jun 19, 2026
20 checks passed
@JSONbored
JSONbored deleted the codex/fix-public-safe-packet-vulnerability branch June 19, 2026 05:50
@github-actions github-actions Bot mentioned this pull request Jun 19, 2026
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant